<?xml version='1.0' encoding='UTF-8'?>

<!DOCTYPE root PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:a4j="http://richfaces.org/a4j"
	xmlns:rich="http://richfaces.org/rich">



	<div class="innerTitle">Lista de Permissões (<h:outputText value="total:#{permissaoBean.entitiesSize}"/>)</div>

	<h:panelGroup styleClass="innerFilter" layout="block">

		<div class="innerTextFilter">Filtro</div>

		<h:inputText value="#{permissaoBean.filter}"></h:inputText>

		<a4j:commandButton value="Pesquisar" action="#{permissaoBean.search}" styleClass="button" reRender="popup"/>

		<a4j:commandButton value="Novo" action="#{permissaoBean.prepareSave}" styleClass="button" reRender="popup"/>

		<rich:dataTable id="listaPermissao" rowClasses="even,odd" value="#{permissaoBean.entities}" var="permissao" rows="10">

			<h:column>
				<f:facet name="header"><h:outputLabel value="Nome"/></f:facet>
				<h:outputText value="#{permissao.nome}"/>
			</h:column>

			<h:column>
				<f:facet name="header"><h:outputLabel value="Descrição"/></f:facet>
				<h:outputText value="#{permissao.descricao}"/>
			</h:column>

			<h:column headerClass="link">
				<a4j:commandLink action="#{permissaoBean.prepareUpdate}" reRender="popup">
					<h:graphicImage styleClass="link" alt="Alterar" url="/images/btn/update.png"/>
					<f:setPropertyActionListener target="#{permissaoBean.entity}" value="#{permissao}"/>
				</a4j:commandLink>
			</h:column>

			<h:column headerClass="link">
				<a4j:commandLink action="#{permissaoBean.delete}" reRender="popup">
					<h:graphicImage styleClass="link" alt="Excluir" url="/images/btn/delete.png"/>
					<f:setPropertyActionListener target="#{permissaoBean.entity}" value="#{permissao}"/>
				</a4j:commandLink>
			</h:column>

            <f:facet name="footer">
				<rich:datascroller renderIfSinglePage="false" reRender="listaPermissao" />
            </f:facet>

		</rich:dataTable>

	</h:panelGroup>

</ui:composition>